// const bodyparser = require("body-parser");
const Mock = require("mockjs");

const data = Mock.mock({
  "list|50": [
    {
      id: "@id",
      name: "name",
      "age|18-60": 18,
      city: "@city",
      email: "@email",
      address: "@county(true)",
      title: "@ctitle",
      img: "@image(120x120 ,@color)",
    },
  ],
});

module.exports = (app) => {
  // app.use(bodyparser.json());

  app.get("/api/list", (req, res) => {
    req.rest({
      code: 200,
      list: data.list,
    });
  });
};
